<%@ page language="java" import="java.util.*, java.text.*,com.zjut.zs.util.tools.*,com.zjut.an.util.tools.*,com.zjut.an.util.system.*,
com.zjut.zs.user.manager.*, com.zjut.zs.user.dao.*,com.zjut.zs.userstatus.manager.*, com.zjut.zs.userstatus.dao.*,
com.zjut.zs.userinfo.manager.*, com.zjut.zs.userinfo.dao.*,com.zjut.zs.file.manager.*, com.zjut.zs.file.dao.*,
com.zjut.zs.cj.manager.*, com.zjut.zs.cj.dao.*,com.zjut.zs.xy.manager.*, com.zjut.zs.xy.dao.*,
com.zjut.zs.zxlb.manager.*, com.zjut.zs.zxlb.dao.*,com.zjut.zs.shhd.manager.*, com.zjut.zs.shhd.dao.*,
com.zjut.zs.exvalue.manager.*, com.zjut.zs.exvalue.dao.*,com.zjut.zs.coname.manager.*, 
com.zjut.zs.school.manager.*, com.zjut.zs.school.dao.*,com.zjut.zs.applyview.dao.*,com.zjut.zs.applyview.manager.*,
com.zjut.an.config.manager.*, com.zjut.an.config.dao.*,com.zjut.an.news.manager.*, com.zjut.an.news.dao.*" pageEncoding="utf-8"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../plugins/assets/plugins/jquery-3.5.1.min.js"></script>
<link href="../apply/css/iconfont/iconfont.css" rel="stylesheet" type="text/css" id="cssfile"/>
<link href="../apply/css/iconfont/demo.css" rel="stylesheet" type="text/css" id="cssfile"/>
</head>
<style type="text/css">
<!--
.infobox {
	width:46%;
	height:300px;
	float:left;
	border:1px solid #eee;
	background:#fff;
	padding:5px;
	margin:5px;
}
.infobox2 {
	width:95%;
	height:250px;
	float:left;
	border:1px solid #eee;
	background:#fff;
	padding:5px;
	margin:5px;
}
.infobox1 {
	height:100px;
}
-->
</style>
<script type="text/javascript">
function info(message) {  
    if (confirm(message)) {  
        window.location='zs_filesend.jsp';
    } 
}
</script>
<body>
<jsp:include page="zs_uservalidate.jsp" flush="true"/>
<%
if (session.getAttribute("zsUser") == null) {
	out.print("<script>alert('由于长时间未操作，系统已经自动注销，请重新登陆');</script>");
	out.print("<script>top.window.location='main.jsp';</script>");
} else {

AnConfigManager anconfig = (AnConfigManager) SpringContextUtil.getBean("AnConfigManager");
AnNewsManager nmanager = (AnNewsManager) SpringContextUtil.getBean("AnNewsManager");
ZsSchoolManager zsManager = (ZsSchoolManager) SpringContextUtil.getBean("ZsSchoolManager");
ZsCoNameManager comanager = (ZsCoNameManager) SpringContextUtil.getBean("ZsCoNameManager");
HTMLCreat html = (HTMLCreat) SpringContextUtil.getBean("HTMLCreat");
ZsHTMLCreat zshtml = (ZsHTMLCreat) SpringContextUtil.getBean("ZsHTMLCreat");
ZsFileManager fmanager = (ZsFileManager) SpringContextUtil.getBean("ZsFileManager");
ZsApplyViewManager amanager = (ZsApplyViewManager) SpringContextUtil.getBean("ZsApplyViewManager");
ZsUserManager umanager = (ZsUserManager) SpringContextUtil.getBean("ZsUserManager");
ZsUserStatusManager zsmanager = (ZsUserStatusManager) SpringContextUtil.getBean("ZsUserStatusManager");
ZsSchool school = new ZsSchool();
school = (ZsSchool)zsManager.getDataByInstance(1,1,null,null,school).getObjects().get(0);

ZsUser user = new ZsUser();
ZsUserStatus userstatus = new ZsUserStatus();
if(session.getAttribute("zsUser")!=null) {
	user = (ZsUser)session.getAttribute("zsUser");
	userstatus = zsmanager.getDataByUser(user);
}

ZsFile file = new ZsFile();
List flist = new ArrayList();
if (user!=null && null!=user.getUsId()) {
	file.setZsUser(user);										
	flist = fmanager.getDataByInstance(1,100,null,null,file).getObjects();
}
StringBuffer filestring = new StringBuffer();
StringBuffer message = new StringBuffer();
for(int i=0; i<flist.size(); i++) {
	file = (ZsFile)flist.get(i);
	filestring.append(file.getFiName()+";");
}
System.out.println("!!!"+filestring+" "+Status.ON.getStatus().equals(school.getScFilesendActive()));
if(Status.ON.getStatus().equals(school.getScFilesendActive())) {
    List fi = anconfig.getConfigsInfoByClass("上传材料名称(必需)");
    System.out.println("!!!"+fi.size());
    if (null!=fi && fi.size()>0) {
	    for (int i=0; i<fi.size(); i++) {
	        String covalue = ((AnConfig)fi.get(i)).getCoValue();
	        System.out.println("!!!"+filestring.indexOf(covalue));
	    	if (filestring.indexOf(covalue)<0) {
	    	    message.append(covalue+"尚未上传,");
	    	    System.out.println("!!!"+message.toString());
	    	}
	    }
    }
    if(message.toString().trim().length()>0 && Status.SENDSTATUS_YES.getStatus().equals(userstatus.getSendStatus())){
    	out.print("<script>info('重要提示："+message+"点击确定上传材料');</script>");
    }
}
 %>
	<div class="place">
    <span>位置：</span>
    <ul class="placeul">
    <li><a href="#">首页</a></li>
    </ul>
    </div>
    
    <div class="mainindex">
    
   	<div class="welinfo infobox2 infobox1">
	    <div class="formtitle"><span><%=user.getUsName() %>你好，欢迎使用<%=anconfig.getSingleConfigInfoByName("网站名称") %></span></div>
	    <a href="zs_user.jsp">帐号设置</a>　|　
	             查看<a href="zs_status.jsp">报考流程</a>　|　
		 当前报名状态：<%if(!(Status.SENDSTATUS_YES.getStatus().equals(userstatus.getSendStatus()) && Status.FILESTATUS_YES.getStatus().equals(userstatus.getFileStatus()))){ 
	    	out.print(" <font color='red'>你的报名尚未完成！</font> ");
	    } else {
	    	out.print(" 你的报名已经提交！ ");
	    }  
	    out.print("　|　报名时间:"+anconfig.getSingleConfigInfoByName("报名时间"));
	    %>
    </div>
	    
     <div class="welinfo infobox2">
		    <div class="formtitle"><span>报考状态</span></div>
		    <ul class=statuslist>  		      	
    			    			 
    			 <%if(Status.SENDSTATUS_YES.getStatus().equals(userstatus.getSendStatus())){ %>
    			<li><p class="finish">申请状态：<br><%=userstatus.getSendStatus() %></p></li>   
    			<%} else {%>		
    			<li><p>申请状态：<br><%=userstatus.getSendStatus() %></p></li>
    			 <%} %>
    			 
    			 <%if(Status.FILESTATUS_YES.getStatus().equals(userstatus.getFileStatus())){ %>
    			<li><p class="finish">材料上传状态：<br><%=userstatus.getFileStatus() %></p></li>   
    			<%} else {%>		
    			<li><p >材料上传状态：<br><%=userstatus.getFileStatus() %></p></li>
    			 <%} %>    			 
    			 
    			 <%if(Status.SENDSTATUS_YES.getStatus().equals(userstatus.getSendStatus()) && Status.FILESTATUS_YES.getStatus().equals(userstatus.getFileStatus())){ %>
    			<li><p class="pass">报名状态：<br>报名成功</p></li>   
    			<%} else {%>		
    			<li><p class="null">报名状态：<br>未完成</p></li>
    			 <%} %>		   
    			
    			<%if(Status.ON.getStatus().equals(school.getScEmsActive())){ //如果开启了EMS结果查询%>    			
    			<%if(Status.EMSSTATUS_YES.getStatus().equals(userstatus.getEmsStatus())){ %>
    			<li><p class="finish">EMS状态：<br><%=userstatus.getEmsStatus()%></p></li>   
    			<%} else {%>		
    			<li><p>EMS状态：<br><%=userstatus.getEmsStatus()%></p></li>
    			<%} %>   			   			  			
    			<%} %>
    			
    			<%if(Status.CHECKSTATUS_YES.getStatus().equals(userstatus.getCheckStatus())){ %>
    			<li><p class="finish">初审状态：<br> <%=userstatus.getCheckStatus() %></p></li>
    			 <%} else {%>	
    			<li><p >初审状态：<br><%=userstatus.getCheckStatus() %></p></li>		    			   
			    <%} %>	
    			 
    			<%if(Status.PAYSTATUS_YES.getStatus().equals(userstatus.getPayStatus())){ %>
    			<li><p class="finish">缴费状态：<br><%=userstatus.getPayStatus() %></p></li>   
    			<%} else {%>		
    			<li><p>缴费状态：<br><%=userstatus.getPayStatus() %></p></li>
    			<%} %>    			
    			 
    			<%if(Status.ON.getStatus().equals(school.getScSearchActive())){ //如果开启了考试结果查询%>
    			<%if(Status.PASSSTATUS_YES.getStatus().equals(userstatus.getPassStatus())){ %>
    			<li><p class="finish">综合测试状态：<br><%=userstatus.getPassStatus() %></p></li>
    			<%} else {%>	
    			<li><p >综合测试状态：<br><%=userstatus.getPassStatus() %></p></li>
			    <%} %>
    			<%} %>  
    		</ul>
    		
    		<%if(Status.CHECKSTATUS_NO.getStatus().equals(userstatus.getCheckStatus())){ %>
			<div><b style="color:#ff0000"><%=anconfig.getSingleConfigInfoByName("初审不过显示") %></b></div>
			<%} else if(Status.CHECKSTATUS_YES.getStatus().equals(userstatus.getCheckStatus())){ %>
			<div><b style="color:#ff0000"><%=anconfig.getSingleConfigInfoByName("初审通过显示") %></b></div>
			<%} %>
			    
			<%if(Status.ON.getStatus().equals(school.getScSearchActive())){ //如果开启了考试结果查询%>
			    <%if(Status.PASSSTATUS_NO.getStatus().equals(userstatus.getPassStatus())){ %>
			    <div><b style="color:#ff0000"><%=anconfig.getSingleConfigInfoByName("综合测试未通过显示") %></b></div>
			    <%} else if (Status.PASSSTATUS_YES.getStatus().equals(userstatus.getPassStatus())){%>
			    <div><b style="color:#ff0000"><%=anconfig.getSingleConfigInfoByName("综合测试通过显示") %></b></div>
			    <%} %>
		    <%} %>
		    
    		<!-- 
		    <span>信息状态：<%=userstatus.getAppStatus() %></span><br/>
		    <span>申请状态：<%=userstatus.getSendStatus() %></span><br/>
		    <span>初审状态：<%=userstatus.getCheckStatus() %>
			    
		    </span><br/>
		    <span>缴费状态：<%=userstatus.getPayStatus() %></span><br>
		    <%if(Status.ON.getStatus().equals(school.getScEmsActive())){ //如果开启了EMS结果查询%>
		    <span>EMS状态：<%=userstatus.getEmsStatus()%></span><br/>
		    <%} %>
		    
		    
		     -->
		    
		    
	    </div>
	    
	    <div class="welinfo infobox">
	    	<div class="formtitle"><span>最新公告</span></div>
	    	<ul class="umlist">
		    <%
		    AnNews news = new AnNews();
		    news.setIsrecommend(Status.ISRECOMMEND_YES.getStatus());
		    List list = nmanager.getDataByInstance(1,10,null,null,news).getObjects();
		    for (int i=0; i<list.size(); i++) {
		    	news = (AnNews)list.get(i);
		     %>
		    <li><a href="<%=html.newslink(news) %>" ><%=news.getTitle() %><span><%=news.getAdddate().toString().substring(0,10) %></span></a></li>
		    <%} %>
		    </ul>
	    </div>
	    
	    <div class="welinfo infobox" style="line-height:20px;">
		    <div class="formtitle"><span>重要提示</span></div>
		    <span><%if (userstatus.getMessage()!=null&&userstatus.getMessage().trim().length()>0)out.print(userstatus.getMessage().replace("null","")); %></span>
	    </div>
	    
    </div>

   <%if(!Status.PAYSTATUS_YES.getStatus().equals(userstatus.getPayStatus())){ 
	   String receiveno = user.getUsNo();
   %>
	<script src="http://swyt.wmu.edu.cn/****/getOracleByUsid.jsp?usId=<%=receiveno%>"></script>
	<%} %>
<%} %>


</body>

</html>
